from ..models import Model


class ResUsers(Model):
    model = 'res.users'
    _name = 'res.users'

    # def login(self, user, password):
    #     session = self.rpc.authenticate(user, password)
    #     user_companies = self.session['user_companies']
    #     allowed_companies = user_companies['allowed_companies']
    #     allowed_company_ids = map(lambda c: c[0], allowed_companies)
    #     self.allowed_company_id = min(allowed_company_ids)
    #     # self.allowed_company_id = max(allowed_company_ids)
    #     return session

    #     # 这个值 要写到 localstore 里.
    #     # 刷新页面时,
    #     # 读 sessionid, 重新 从服务器取 session info,
    #     # 且 从 localstore 取 allowed_company_id, 写到 api 里
